<template>
  <div class="detail_box">
    <div class="title">
      <div>{{ form.strategyName }}</div>
    </div>
    <el-form class="left_from" ref="form" :model="form" label-width="80px" :disabled="true">
      <el-form-item label="策略名称" prop="strategyName">
        <el-input v-model="form.strategyName" placeholder="请输入策略名称"/>
      </el-form-item>
      <el-form-item label="涉及问题" prop="issuesInvolved">
        <el-select v-model="form.issuesInvolved" placeholder="请选择涉及问题">
          <el-option
            v-for="dict in dict.type.ps_industry"
            :key="dict.value"
            :label="dict.label"
            :value="parseInt(dict.value)"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item  label="策略描述" >
        <editor ref="editorSon" v-model="form.strategyDesc" :min-height="192"/>
      </el-form-item>
    </el-form>
  </div>

</template>

<script>
import {listStrategy, getStrategy, delStrategy, addStrategy, updateStrategy} from "@/api/strategy/strategy";

export default {
  name: "index",
  dicts: ['ps_industry'],
  data() {
    return {
      userInfo: JSON.parse(localStorage.getItem('userinfo')),
      id: '',
      tableData: [],
      drawer: false,
      strategyName: '',
      strategyDesc: '',
      strategyList: [],
      form: {},
    }
  },
  methods: {
    getList(id) {
      getStrategy(id).then(response => {
        console.log(response)
        this.form = response.data;
        this.$nextTick(()=>{
          this.$refs.editorSon.Quill.enable(false)
        })
      });
    },
  },
  created() {
    this.Id = this.$route.query.id
    this.getList(this.Id)
  }
}
</script>


<style scoped lang="scss">
.detail_box{
  width: 100%;
  height: calc(100vh - 86px);
  box-sizing: border-box;
  padding: 0 10%;
  overflow-y: auto;
  padding-top: 30px;
  position: relative;
}
.title{
  width: 100%;
  display: flex;
  justify-content: center;
  font-size:22px;
  color: #333;
  font-weight: 600;
  margin-bottom:40px;
  div{
    max-width: 70%;
    overflow:hidden; //超出的文本隐藏
    text-overflow:ellipsis; //用省略号显示
    white-space:nowrap; //不换行
    margin-right: 20px;
  }
}

</style>
